<?php
include_once '../../Model/M_Rubro.php';
include_once '../../Model/M_SubRubro.php';

//$subrubro = new M_SubRubro();
$rubro = new M_Rubro();

$lista = $rubro->searchRubro_All();
?>
<!DOCTYPE HTML>
<html lang="es">    
    <head>
        <title>Pedidos</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">       


        <script LANGUAGE="JavaScript">
            function confirmSubmit()
            {
                var agree = confirm("¿Desea realmente ELIMINAR este registro?");
                if (agree)
                    return true;
                else
                    return false;
            }
            // -->
        </script>

        <style>
            #pedido_izq{

                float: left;
                width: 40%;
                min-height: 500px;
                background: #0972a5;

            }
            #pedido_der{

                float: left;
                width: 60%;
                min-height: 500px;                
            }

            #pedido_der_top{
                position: relative;
                height: 400px;
                width: 100%;
                background: white;
                overflow: auto;     
                border-style: inset;
            }

            .pedido_der_down{
                position: relative;
                height: 150px;
                width: 100%;
                background: lightgoldenrodyellow;
                overflow: auto;     
                border-style: inset;
            }

            .pedido_izq_top{
                position: relative;
                height: 250px;
                width: 100%;
                background: whitesmoke;
                overflow: auto;                
                border-style: inset;
            }

            .pedido_izq_down{
                position: relative;
                height: 300px;
                width: 100%;
                background: rgb(252,255,244); /* Old browsers */
                background: -moz-linear-gradient(top,  rgba(252,255,244,1) 0%, rgba(223,229,215,1) 40%, rgba(179,190,173,1) 100%); /* FF3.6+ */
                background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(252,255,244,1)), color-stop(40%,rgba(223,229,215,1)), color-stop(100%,rgba(179,190,173,1))); /* Chrome,Safari4+ */
                background: -webkit-linear-gradient(top,  rgba(252,255,244,1) 0%,rgba(223,229,215,1) 40%,rgba(179,190,173,1) 100%); /* Chrome10+,Safari5.1+ */
                background: -o-linear-gradient(top,  rgba(252,255,244,1) 0%,rgba(223,229,215,1) 40%,rgba(179,190,173,1) 100%); /* Opera 11.10+ */
                background: -ms-linear-gradient(top,  rgba(252,255,244,1) 0%,rgba(223,229,215,1) 40%,rgba(179,190,173,1) 100%); /* IE10+ */
                background: linear-gradient(to bottom,  rgba(252,255,244,1) 0%,rgba(223,229,215,1) 40%,rgba(179,190,173,1) 100%); /* W3C */
                filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fcfff4', endColorstr='#b3bead',GradientType=0 ); /* IE6-9 */
                border-style: inset;
                overflow: auto;                  
            }
            .vista_subrubro{
                float: left;
                width: 90px;
                height: 70px;
                background: rgb(226,226,226); /* Old browsers */
                background: -moz-linear-gradient(top,  rgba(226,226,226,1) 0%, rgba(219,219,219,1) 50%, rgba(209,209,209,1) 51%, rgba(254,254,254,1) 100%); /* FF3.6+ */
                background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(226,226,226,1)), color-stop(50%,rgba(219,219,219,1)), color-stop(51%,rgba(209,209,209,1)), color-stop(100%,rgba(254,254,254,1))); /* Chrome,Safari4+ */
                background: -webkit-linear-gradient(top,  rgba(226,226,226,1) 0%,rgba(219,219,219,1) 50%,rgba(209,209,209,1) 51%,rgba(254,254,254,1) 100%); /* Chrome10+,Safari5.1+ */
                background: -o-linear-gradient(top,  rgba(226,226,226,1) 0%,rgba(219,219,219,1) 50%,rgba(209,209,209,1) 51%,rgba(254,254,254,1) 100%); /* Opera 11.10+ */
                background: -ms-linear-gradient(top,  rgba(226,226,226,1) 0%,rgba(219,219,219,1) 50%,rgba(209,209,209,1) 51%,rgba(254,254,254,1) 100%); /* IE10+ */
                background: linear-gradient(to bottom,  rgba(226,226,226,1) 0%,rgba(219,219,219,1) 50%,rgba(209,209,209,1) 51%,rgba(254,254,254,1) 100%); /* W3C */
                filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#e2e2e2', endColorstr='#fefefe',GradientType=0 ); /* IE6-9 */
                margin: 2px;
                padding: 3px;
                margin-top: 7px;
                text-align: center;
                font-size: 8px;
                font-weight: bold;
            }

            .info1{
                float: left;

            }
            .info2{
                float: right;
            }

        </style>
        <script type='text/javascript' src='../js/funciones.js'></script>

        <script type="text/javascript">


            function loadurl(url, id) {
                var pagecnx = createXMLHttpRequest();
                pagecnx.onreadystatechange = function() {
                    if (pagecnx.readyState == 4 && (pagecnx.status == 200 || window.location.href.indexOf("http") == -1))
                        document.getElementById(id).innerHTML = pagecnx.responseText;
                }
                pagecnx.open('GET', url, true)
                pagecnx.send(null)
            }

            function loadurlkey(e, url, id) {
                tecla = (document.all) ? e.keyCode : e.which;
                if (tecla == 13)
                    loadurl(url, id);
            }

            function createXMLHttpRequest() {
                var xmlHttp = null;
                if (window.ActiveXObject)
                    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
                else if (window.XMLHttpRequest)
                    xmlHttp = new XMLHttpRequest();
                return xmlHttp;
            }

            function startTime()
            {
                today = new Date();
                h = today.getHours();
                m = today.getMinutes();
                s = today.getSeconds();
                m = checkTime(m);
                s = checkTime(s);
                document.getElementById('reloj').innerHTML = h + ":" + m + ":" + s;
                t = setTimeout('startTime()', 500);
            }

            function checkTime(i)
            {
                if (i < 10) {
                    i = "0" + i;
                }
                return i;
            }
            window.onload = function() {
                startTime();
            }

            function obtenerMinutos() {
                var d = new Date();
                document.write(d.getDate());
            }
        </script>

        <script type="text/javascript">
            var time;
            var on = false;
            var seconds = 0;
            var minutes = 0;

            var startTime = function() {
                seconds++;
                time = setTimeout("startTime()", 1000);
                if (seconds > 59) {
                    seconds = 0;
                    minutes++;
                }
                document.getElementById("minutes").value = minutes;
                // Mostar segundos
                document.getElementById("seconds").value = seconds;
                // Mostar segundos
            }

            var stopStart = function() {
                document.getElementById("time").innerHTML = !on ? "Stop" : "Start";
                if (!on) {
                    on = true;
                    startTime();
                } else {
                    on = false;
                    clearTimeout(time);
                }
            }
        </script>

    </head>
    <body>

        <div style="margin: auto;">
            <div id="pedido_izq">
                <div class="pedido_izq_top">

                    <table border="1" style="font-size: 12px;" width="100%" >
                        <thead>
                            <tr>
                                <th>Nro</th>
                                <th>Item</th>
                                <th>Cant</th>
                                <th>Sub Total</th>
                                <th></th>
                                <th></th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td>1</td>
                                <td>Chaufa</td>
                                <td>1</td>
                                <td>S/. 18,00</td>
                                <td></td>
                                <td><input type="submit" value="Quitar" /></td>
                            </tr>
                            <tr>
                                <td>2</td>
                                <td>Aji de Gallina</td>
                                <td>1</td>
                                <td>S/. 22,00</td>
                                <td></td>
                                <td></td>
                            </tr>
                            <tr>
                                <td>3</td>
                                <td>Coca Cola 1lt</td>
                                <td>1</td>
                                <td>S/. 8,00</td>
                                <td></td>
                                <td></td>
                            </tr>
                            <tr>
                                <td>4</td>
                                <td>Cerveza Pilsen Trujillo</td>
                                <td>2</td>
                                <td>S/. 10,00</td>
                                <td></td>
                                <td></td>
                            </tr>
                            <tr>
                                <td>1</td>
                                <td>Chaufa</td>
                                <td>1</td>
                                <td>S/. 18,00</td>
                                <td></td>
                                <td><input type="submit" value="Quitar" /></td>
                            </tr>
                            <tr>
                                <td>1</td>
                                <td>Chaufa</td>
                                <td>1</td>
                                <td>S/. 18,00</td>
                                <td></td>
                                <td><input type="submit" value="Quitar" /></td>
                            </tr>
                            <tr>
                                <td>1</td>
                                <td>Chaufa</td>
                                <td>1</td>
                                <td>S/. 18,00</td>
                                <td></td>
                                <td><input type="submit" value="Quitar" /></td>
                            </tr>
                            <tr>
                                <td>1</td>
                                <td>Chaufa</td>
                                <td>1</td>
                                <td>S/. 18,00</td>
                                <td></td>
                                <td><input type="submit" value="Quitar" /></td>
                            </tr>
                            <tr>
                                <td>1</td>
                                <td>Chaufa</td>
                                <td>1</td>
                                <td>S/. 18,00</td>
                                <td></td>
                                <td><input type="submit" value="Quitar" /></td>
                            </tr>
                        </tbody>
                    </table>

                </div>
                <div class="pedido_izq_down">
                    <? for ($i = 0; $i < count($lista); $i++) { ?>
                        <div class="vista_subrubro">
                            <? $codigo = $lista[$i]['id_rubro']; ?>                                                        
                            <a href="javascript:FAjax('../Pedido/V_SubRubro.php', 'pedido_der_top', 'codigo=<?= $codigo ?>', 'POST');" ><img height="60" width="90" src="../images/Rubro/<?= $lista[$i]['imagen']; ?>"/>  </a>
                            <?= $lista[$i]['nombre']; ?>
                        </div>
                    <? } ?>
                </div>


            </div>
            <div id="pedido_der">
                <div id="pedido_der_top">
                    <br/>
                    <center><img src="../images/zonamenu.jpg"/></center>
                </div>
                <div class="pedido_der_down">
                    <div class="info1">
                        Mesas: M1, M2, M3<br/>
                        Nro Personas: <input style="width: 50px" type="number" name="npersonas" value="" /><br/>
                        Nro Cubiertos: <input style="width: 50px" type="number" name="npersonas" value="" /><br/>
                        <p>Saldo Total:</p>
                        <h3>S/.120,00</h3>
                    </div>
                    <div class="info2">
                        Tiempo Transcurrido:                         
                        <input style="width: 20px; border: none; " type="text" id="minutes" value="0" />
                        <!-- // Mostar segundos -->
                        :<input style="width: 20px; border: none; " type="text" id="seconds" value="0" />
                        <!--                        <div id="reloj" style="font-size:20px;"></div>-->
                        <br/>Hora Entrada: 14:20:00<br/>
                        <input type="submit" value="Salir" /><br/>
                        <input type="submit" value="Enviar a Cocina" /><br/>
                        <input type="submit" value="Eliminar Pedido" /><br/>
                        <input type="submit" value="Finalizar Pedido" />



                    </div>
                    <div style="clear: both;"></div>                    
                </div>

            </div>
            <div style="clear: both;"></div>
        </div>

    </body>    
</html>

